<template>
    <van-button @click="lgout" type="primary">注销登录</van-button>
</template>

<script name="sdySelf" lang="ts" setup>
import { showSuccessToast } from 'vant'
import { useRouter } from 'vue-router'

const $myRouter = useRouter()

const lgout = () => {
    window.localStorage.removeItem('token')
    window.localStorage.removeItem('user_id')
    showSuccessToast('退出成功')
    $myRouter.push({ path: '/home' })
}

</script>

<style scoped lang="scss"></style>